<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;

/**
 * @property int $id
 * @property int $users_id 用户
 * @property int $weigh 权重
 * @property string $createtime
 * @property string $image 图片
 * @mixin \think\Model
 */
class UsersAlbum extends Model
{
    protected $createTime = 'createtime';


    public static function onAfterInsert(Model $model): void
    {
        $pk = $model->getPk();
        $model->where($pk, $model[$pk])->update(['weigh' => $model[$pk]]);
    }
}
